import React, { useState, useEffect } from 'react'
import ObjectContent from '../ObjectContent'
import { Row, Col, Table, Modal, Icon} from 'antd'
import { connect } from 'dva'
// import FoldTable from '../FoldTable'
import checkColums from 'columns/deviceCheck'
import tools from 'columns/tools'

import Paging from 'components/common/paging'
import './index.styl'

export default function ObjectInfo ({ data, flag }) {
    console.log('data', data)
    console.log('flag', flag)
    // const[list, setList] = useState([])
    // // 当点检项目为草稿状态下，不显示已经删除的任务，因此对数据进行过滤
    // useEffect(()=>{
    //     if(data && data.checkTaskVoList){
    //         if (data.status === 5) {
    //             const listData = data.checkTaskVoList.filter(item => item.deleted === 'N')
    //             setList(listData)
    //             return
    //         }
    //         setList(data.checkTaskVoList)
    //     }
    // },[data])

    // -------------------------------------------------------------------------------------------------------
    return (
        <div className='deviceCheck_objectInfo'>
            
            <ObjectContent  
                data={data} 
                key={data.id} 
            />
            {/* {
                list.map((item, index) => {
                    return <ObjectContent  
                            data={item} 
                            key={item.id} 
                            // oneList={
                            //     item && item.checkTaskCaseVo 
                            //     ? 
                            //     [item.checkTaskCaseVo] 
                            //     : 
                            //     []
                            // }
                            />
                })
            } */}
        </div>
    )
}

// export default connect(({ deviceCheck }) => ({
//     deviceCheck
//   }))(ObjectInfo)